home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / The Hacks! / The Crash Manager / "source" / thebigpicture.p < prev   
Encoding:
Text File  |  1998-06-20  |  1.9 KB  |  93 lines  |  [TEXT/CWIE]

  1. unit thebigpicture;
  2.  
  3. interface
  4.  
  5. procedure DrawBigPicture;
  6.  
  7. implementation
  8.  
  9. uses
  10.     globals,
  11.     LowMem,
  12.     QuickDraw,
  13.     Windows,
  14.     Resources;
  15.     
  16. type
  17.     PICTinfo=record
  18.         size:integer;
  19.         frame:Rect;
  20.     end;
  21.     PICTinfoPtr=^PICTinfo;
  22.     PICTinfoH=^PICTinfoPtr;
  23.     
  24. procedure DrawBigPicture;
  25. var
  26.     theH:integer;
  27.     theWindow:WindowPtr;
  28.     r,importRect:Rect;
  29.     tempRgn,oldRgn:RgnHandle;
  30.     RGBblueColor:RGBColor;
  31.     thePic:PicHandle;
  32. begin
  33.     with r do begin
  34.         top:=0;
  35.         bottom:=10;
  36.         left:=0;
  37.         right:=10;
  38.     end;
  39.     theWindow:=NewWindow(nil,r,'',false,noGrowDocProc,WindowPtr(-1),false,0);
  40.     SetPort(theWindow);
  41.     importRect:=qd.thePort^.portBits.bounds;
  42.  
  43.     theH:=GetMBarHeight;
  44.     LMSetMBarHeight(0);
  45.     SizeWindow(theWindow,importRect.right,importRect.bottom,false);
  46.     ShowWindow(theWindow);
  47.     MoveWindow(theWindow,0,0,true);
  48.     tempRgn:=NewRgn;
  49.     oldRgn:=NewRgn;
  50.     CopyRgn(theWindow^.clipRgn,oldRgn);
  51.     SetRectRgn(tempRgn,0,0,importRect.right,importRect.bottom);
  52.     UnionRgn(tempRgn,oldRgn,theWindow^.clipRgn);
  53.     theWindow^.visRgn:=theWindow^.clipRgn;
  54.     ForeColor(blackColor);
  55.     PaintRect(importRect);
  56.     HideCursor;
  57.     
  58.     case GetControlValue(gTypePopUp) of
  59.         1: {BSOD} begin
  60.                 with RGBblueColor do begin
  61.                     red:=41*256;
  62.                     green:=65*256;
  63.                     blue:=240*256;
  64.                 end;
  65.                 RGBForeColor(RGBblueColor);
  66.                 PaintRect(importRect);
  67.             end;
  68.         2,3: {GPF,CM} begin
  69.                 thePic:=GetPicture(2999+GetControlValue(gTypePopUp));
  70.                 with r do begin
  71.                     top:=importRect.bottom div 2 - PICTinfoH(thePic)^^.frame.bottom div 2;
  72.                     bottom:=top+PICTinfoH(thePic)^^.frame.bottom;
  73.                     left:=importRect.right div 2 - PICTinfoH(thePic)^^.frame.right div 2;
  74.                     right:=left+PICTinfoH(thePic)^^.frame.right;
  75.                 end;
  76.                 DrawPicture(thePic,r);
  77.                 ReleaseResource(Handle(thePic));
  78.             end;
  79.     end;
  80.     
  81.     while not Button do;
  82.     FlushEvents(everyEvent - osMask - diskMask, 0);
  83.     
  84.     LMSetMBarHeight(theH);
  85.     DisposeRgn(tempRgn);
  86.     DisposeRgn(oldRgn);
  87.     DisposeWindow(theWindow);
  88.     SetPort(gMainWindow);
  89.     ShowCursor;
  90.     DrawMenuBar;
  91. end;
  92.  
  93. end.